package com.lock.controller;

import com.lock.service.StockService;
import com.lock.service.StockService2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: distinct-lock
 * @description:
 * @author: 闫克起2
 * @create: 2022-02-17 15:50
 **/
@RestController
public class StockController {

    @Autowired
    private StockService2 stockService2;

    //根据商品编号减库存 每次减一个
    @GetMapping("/incr/{productid}")
    public String incr(@PathVariable Integer productid){
        return stockService2.decrement(productid);
    }
}
